//# sourceURL=dynamicScript.js
$ ( function () {
    selectdy()
})

function selectdy() {
    $("#tabscx").bootstrapTable({
        //请求方式  get请求中文会乱码，建议使用post请求
        method: 'post',
        //请求头部的设置
        contentType: 'application/json',
        //url
        url: '/selectByPrimaryKeyfhcx',
        //设置交替行样式
        striped: true,
        //初始显示页号
        pageNumber: 1,
        //设置表格高度
        //height: 350,
        //是否显示分页
        pagination: true,
        //设置是服务端分页还是客户端分页
        sidePagination: 'server',
        //页大小
        pageSize: 3,
        //分页列表
        pageList: [3, 5, 6, 10],
        //上传到服务端的参数
        queryParams:function (parms) {
            return{
                num:(parms.offset/parms.limit)+1,
                size:parms.limit,
            }
        },
        //定义列名
        columns:[
            {title:"产品I级分类",field:"firstkindname",align:"center"},
            {title:"产品II级分类",field:"secondkindname",align:"center"},
            {title:"产品III级分类",field:"thirdkindname",align:"center"},
            {title:"产品编号",field:"prouctid",align:"center"},
            {title:"产品名称",field:"prouctname",align:"center"},
            {title:"库存量",field:"amount",align:"center",
                formatter:function (vale,row,index) {
                    var pan="";

                    if (row.amount>row.maxamount)
                    {
                        pan+="<span style='color: red'>"+row.amount+"</span>";
                    }else if (row.amount<row.minamount){
                        pan+="<span style='color: blue'>"+row.amount+"</span>";
                    }else {
                        pan+="<span>"+row.amount+"</span>";
                    }
                    return pan;
                }
            },
            {title:"安全储存上限",field:"maxamount",align:"center"},
            {title:"安全储存下限",field:"minamount",align:"center"},
        ]
    })
}
function rk(id) {
    location.href="../selectrws?id="+id;
}
